<!DOCTYPE html>
<html lang="en"><head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1"><!-- Begin Jekyll SEO tag v2.8.0 -->
<title>0051: MVC IV – A ComboBox with Text | gtkDcoding</title>
<meta name="generator" content="Jekyll v4.3.4" />
<meta property="og:title" content="0051: MVC IV – A ComboBox with Text" />
<meta name="author" content="Ron Tarrant" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="A tutorial on reproducing the GTK ComboBoxText using a ComboBox and a ListStore." />
<meta property="og:description" content="A tutorial on reproducing the GTK ComboBoxText using a ComboBox and a ListStore." />
<link rel="canonical" href="http://localhost:4000/posts/0051-mvc-iv-combobox-text.html" />
<meta property="og:url" content="http://localhost:4000/posts/0051-mvc-iv-combobox-text.html" />
<meta property="og:site_name" content="gtkDcoding" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2019-07-09T00:00:00-04:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="0051: MVC IV – A ComboBox with Text" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"Ron Tarrant"},"dateModified":"2019-07-09T00:00:00-04:00","datePublished":"2019-07-09T00:00:00-04:00","description":"A tutorial on reproducing the GTK ComboBoxText using a ComboBox and a ListStore.","headline":"0051: MVC IV – A ComboBox with Text","mainEntityOfPage":{"@type":"WebPage","@id":"http://localhost:4000/posts/0051-mvc-iv-combobox-text.html"},"url":"http://localhost:4000/posts/0051-mvc-iv-combobox-text.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="../assets/main.css">
  <link rel="stylesheet" href="../css/style.css" /><link type="application/atom+xml" rel="alternate" href="http://localhost:4000/feed.xml" title="gtkDcoding" /></head>
<body><header class="site-header" role="banner">

  <div class="wrapper"><a class="site-title" rel="author" href="../">gtkDcoding</a><nav class="site-nav">
        <input type="checkbox" id="nav-trigger" class="nav-trigger" />
        <label for="nav-trigger">
          <span class="menu-icon">
            <svg viewBox="0 0 18 15" width="18px" height="15px">
              <path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
            </svg>
          </span>
        </label>

        <div class="trigger"><a class="page-link" href="../about.html">About</a><a class="page-link" href="../index-reverse.html">Posts in Date Order</a><a class="page-link" href="../topics.html">Blog Posts by Topic</a></div>
      </nav></div>
</header>
<main class="page-content" aria-label="Content">
      <div class="wrapper">
        <article class="post h-entry" itemscope itemtype="http://schema.org/BlogPosting">
	<header class="post-header">
		<link rel="stylesheet" href="../css/font_size.css" />
		<link rel="stylesheet" href="../css/figure.css" />
		<link rel="stylesheet" href="../css/topics/mvc.css" />  <!-- sub in the tag/topic -->
		<link rel="stylesheet" href="../css/modal.css" />
		<link rel="stylesheet" href="../css/post.css" />
		<link rel="stylesheet" href="../css/mascot_effects.css" />

		
		
		<p class="post-meta">
		<time class="dt-published" datetime="2019-07-09T00:00:00-04:00" itemprop="datePublished">Tuesday, July 9, 2019
		</time>• by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span class="p-author h-card" itemprop="name">Ron Tarrant</span></span></p>
	</header>

	<div class="post-content e-content" itemprop="articleBody">
		<div class="skew-line"></div>
		<h1 id="0051-mvc-iv--the-combobox-with-text">0051: MVC IV – The ComboBox with Text</h1>

<div class="screenshot-frame">
	<div class="frame-header">
		Results of this example:
	</div>
	<div class="frame-screenshot">
		<figure>
			<img id="img0" src="../images/screenshots/017_mvc/mvc_06.png" alt="Current example output" />		<!-- img# -->
			
			<!-- Modal for screenshot -->
			<div id="modal0" class="modal">																	<!-- modal# -->
				<span class="close0">&times;</span>															<!-- close# -->
				<img class="modal-content" id="img00" />															<!-- img## -->
				<div id="caption"></div>
			</div>
			
			<script>
			// Get the modal
			var modal = document.getElementById("modal0");														// modal#
			
			// Get the image and insert it inside the modal - use its "alt" text as a caption
			var img = document.getElementById("img0");															// img#
			var modalImg = document.getElementById("img00");													// img##
			var captionText = document.getElementById("caption");

			img.onclick = function()
			{
			  modal.style.display = "block";
			  modalImg.src = this.src;
			  captionText.innerHTML = this.alt;
			}
			
			// Get the <span> element that closes the modal
			var span = document.getElementsByClassName("close0")[0];											// close#
			
			// When the user clicks on <span> (x), close the modal
			span.onclick = function()
			{ 
				modal.style.display = "none";
			}
			</script>
			<figcaption>
			Current example output
			</figcaption>
		</figure>
	</div>

	<div class="frame-terminal">
		<figure class="right">
			<img id="img1" src="../images/screenshots/017_mvc/mvc_06_term.png" alt="Current example terminal output" />		<!-- img#, filename -->

			<!-- Modal for terminal shot -->
			<div id="modal1" class="modal">																				<!-- modal# -->
				<span class="close1">&times;</span>																		<!-- close# -->
				<img class="modal-content" id="img11" />																		<!-- img## -->
				<div id="caption"></div>
			</div>
			
			<script>
			// Get the modal
			var modal = document.getElementById("modal1");																	// modal#
			
			// Get the image and insert it inside the modal - use its "alt" text as a caption
			var img = document.getElementById("img1");																		// img#
			var modalImg = document.getElementById("img11");																// img##
			var captionText = document.getElementById("caption");

			img.onclick = function()
			{
			  modal.style.display = "block";
			  modalImg.src = this.src;
			  captionText.innerHTML = this.alt;
			}
			
			// Get the <span> element that closes the modal
			var span = document.getElementsByClassName("close1")[0];														// close#
			
			// When the user clicks on <span> (x), close the modal
			span.onclick = function()
			{ 
				modal.style.display = "none";
			}
			</script>

			<figcaption>
				Current example terminal output (click for enlarged view)
			</figcaption>
		</figure>
	</div>

	<div class="frame-footer">																								<!-- ------------- filename (below) --------- -->
		The code file for this example is available <a href="https://github.com/rontarrant/gtkd_demos/blob/master/017_mvc/mvc_06_combobox_liststore.d" target="_blank">here</a>.
	</div>
</div>

<p>Today starts a mini-series within our <strong>MVC</strong> series in which we look at a simple <code class="language-plaintext highlighter-rouge">ComboBox</code> example to reproduce what we’ve already done with the <code class="language-plaintext highlighter-rouge">ComboBoxText</code>.</p>

<p>So… unlike the <code class="language-plaintext highlighter-rouge">ComboBoxText</code>—which you more or less just throw strings at—the <code class="language-plaintext highlighter-rouge">ComboBox</code> needs an actual <code class="language-plaintext highlighter-rouge">Model</code> (<code class="language-plaintext highlighter-rouge">ListStore</code> or <code class="language-plaintext highlighter-rouge">TreeStore</code>) to draw text strings from. This is a little more work than it was with the <code class="language-plaintext highlighter-rouge">ComboBoxText</code>, so let’s dig in…</p>

<h2 id="the-model">The Model</h2>

<p>We start with a <code class="language-plaintext highlighter-rouge">ListStore</code> class:</p>

<div class="language-d highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">class</span> <span class="n">SignListStore</span> <span class="p">:</span> <span class="n">ListStore</span>
<span class="p">{</span>
	<span class="nb">string</span><span class="p">[]</span> <span class="n">items</span> <span class="p">=</span> <span class="p">[</span><span class="s">"bike"</span><span class="p">,</span> <span class="s">"bump"</span><span class="p">,</span> <span class="s">"cow"</span><span class="p">,</span> <span class="s">"deer"</span><span class="p">,</span> <span class="s">"crumbling cliff"</span><span class="p">,</span> <span class="s">"man with a stop sign"</span><span class="p">,</span> <span class="s">"skidding vehicle"</span><span class="p">];</span>
	<span class="n">TreeIter</span> <span class="n">treeIter</span><span class="p">;</span>
	
	<span class="k">this</span><span class="p">()</span>
	<span class="p">{</span>
		<span class="k">super</span><span class="p">([</span><span class="n">GType</span><span class="p">.</span><span class="n">STRING</span><span class="p">]);</span>
		
		<span class="k">foreach</span><span class="p">(</span><span class="kt">ulong</span> <span class="n">i</span><span class="p">;</span> <span class="mf">0.</span><span class="p">.</span><span class="n">items</span><span class="p">.</span><span class="n">length</span><span class="p">)</span>
		<span class="p">{</span>
			<span class="nb">string</span> <span class="n">message</span> <span class="p">=</span> <span class="n">items</span><span class="p">[</span><span class="n">i</span><span class="p">];</span>
			<span class="n">treeIter</span> <span class="p">=</span> <span class="n">createIter</span><span class="p">();</span>
			<span class="n">setValue</span><span class="p">(</span><span class="n">treeIter</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">message</span><span class="p">);</span>
		<span class="p">}</span>

	<span class="p">}</span> <span class="c1">// this()</span>

<span class="p">}</span> <span class="c1">// class SignListStore</span>
</code></pre></div></div>

<p>Now, there are similarities. We still have a string array, but how we handle it is quite different.</p>

<h3 id="the-model-constructor">The Model Constructor</h3>

<p>The <code class="language-plaintext highlighter-rouge">ListStore</code> constructor takes an array of <code class="language-plaintext highlighter-rouge">GTypes</code> and these define the data types each column in the <code class="language-plaintext highlighter-rouge">ListStore</code> will hold. The <code class="language-plaintext highlighter-rouge">GType enum</code>, found in <code class="language-plaintext highlighter-rouge">generated/gtkd/gobject/c/types.d</code>, defines all the built-in types we can use here. Later, when we look at more complex examples, we’ll go over how to deal with more complex types, but for now, these will do.</p>

<p>You’ll note that the call to <code class="language-plaintext highlighter-rouge">super()</code> still gets an array for an argument, even though we’re only using one data type. And, of course, because there’s only one element in the array, there will be only one column.</p>

<p>The <code class="language-plaintext highlighter-rouge">foreach()</code> loop steps through the array, picks one of the <code class="language-plaintext highlighter-rouge">items</code>, instantiates a <code class="language-plaintext highlighter-rouge">TreeIter</code>, and then sets the value in the <code class="language-plaintext highlighter-rouge">ListStore</code> row.</p>

<p>The <code class="language-plaintext highlighter-rouge">setValue()</code> arguments are:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">treeIter</code> – a pointer to the <code class="language-plaintext highlighter-rouge">ListStore</code> row where we’ll store the current data,</li>
  <li><code class="language-plaintext highlighter-rouge">0</code> – the column number (in this case the only column we have) within the <code class="language-plaintext highlighter-rouge">ListStore</code> where the data will end up, and</li>
  <li><code class="language-plaintext highlighter-rouge">message</code> – the string data we’re storing.</li>
</ul>

<h2 id="the-viewcontrol">The View/Control</h2>

<p>The <code class="language-plaintext highlighter-rouge">ComboBox</code> acts as both <strong>View</strong> and <strong>Control</strong>. Keep in mind that it’s based on the <code class="language-plaintext highlighter-rouge">CellLayout</code> interface and so it a non-standard implementation of the <strong>MVC</strong> paradigm. But, no matter. The results are so similar, they make no real difference, so let’s carry on.</p>

<p>Let’s look at the <code class="language-plaintext highlighter-rouge">SignComboBox</code> a bit at a time starting with…</p>

<h3 id="the-initialization-chunk">The Initialization Chunk</h3>

<div class="language-d highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">class</span> <span class="n">SignComboBox</span> <span class="p">:</span> <span class="n">ComboBox</span>
<span class="p">{</span>
	<span class="k">private</span><span class="p">:</span>
	<span class="kt">bool</span> <span class="n">entryOn</span> <span class="p">=</span> <span class="kc">false</span><span class="p">;</span>
	<span class="n">SignListStore</span> <span class="n">_signListStore</span><span class="p">;</span>
	<span class="n">CellRendererText</span> <span class="n">cellRendererText</span><span class="p">;</span>
	<span class="kt">int</span> <span class="n">visibleColumn</span> <span class="p">=</span> <span class="mi">0</span><span class="p">;</span>
	<span class="kt">int</span> <span class="n">activeItem</span> <span class="p">=</span> <span class="mi">0</span><span class="p">;</span>
</code></pre></div></div>

<p>Here’s what these are:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">entryOn</code> we’ve used before and with it being false, it stops the <code class="language-plaintext highlighter-rouge">ComboBox</code> from including an <code class="language-plaintext highlighter-rouge">Entry</code> widget,</li>
  <li><code class="language-plaintext highlighter-rouge">_signListStore</code> is just a convenient (and local) place to keep a pointer to the <code class="language-plaintext highlighter-rouge">ListStore</code>,</li>
  <li><code class="language-plaintext highlighter-rouge">cellRendererText</code> tells the <code class="language-plaintext highlighter-rouge">ComboBox</code> that we’ll be working with and displaying text items,</li>
  <li><code class="language-plaintext highlighter-rouge">visibleColumn</code> is the <code class="language-plaintext highlighter-rouge">ListStore</code> column number from which we’ll draw data, and</li>
  <li><code class="language-plaintext highlighter-rouge">activeItem</code> is the <code class="language-plaintext highlighter-rouge">ListStore</code> row number (index) that’ll be selected by default.</li>
</ul>

<p>We’ll talk more about the <code class="language-plaintext highlighter-rouge">visibleColumn</code> variable and <code class="language-plaintext highlighter-rouge">CellRenderer</code>s of various types when we look at other examples later in this mini-series.</p>

<h3 id="the-constructor">The Constructor</h3>

<div class="language-d highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">public</span><span class="p">:</span>
<span class="k">this</span><span class="p">(</span><span class="n">SignListStore</span> <span class="n">signListStore</span><span class="p">)</span>
<span class="p">{</span>
	<span class="k">super</span><span class="p">(</span><span class="n">entryOn</span><span class="p">);</span>
	
	<span class="c1">// set up the ComboBox's column to render text</span>
	<span class="n">cellRendererText</span> <span class="p">=</span> <span class="k">new</span> <span class="n">CellRendererText</span><span class="p">();</span>
	<span class="n">packStart</span><span class="p">(</span><span class="n">cellRendererText</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
	<span class="n">addAttribute</span><span class="p">(</span><span class="n">cellRendererText</span><span class="p">,</span> <span class="s">"text"</span><span class="p">,</span> <span class="n">visibleColumn</span><span class="p">);</span>
	
	<span class="c1">// set up and bring in the store</span>
	<span class="n">_signListStore</span> <span class="p">=</span> <span class="n">signListStore</span><span class="p">;</span>
	<span class="n">setModel</span><span class="p">(</span><span class="n">_signListStore</span><span class="p">);</span>
	<span class="n">setActive</span><span class="p">(</span><span class="n">activeItem</span><span class="p">);</span>
	
	<span class="n">addOnChanged</span><span class="p">(&amp;</span><span class="n">doSomething</span><span class="p">);</span>
	
<span class="p">}</span> <span class="c1">// this()</span>
</code></pre></div></div>

<p>After the instantiation of the super-class, we have three stages to this constructor:</p>

<ul>
  <li>setting up and packing the <code class="language-plaintext highlighter-rouge">CellRenderer</code>,</li>
  <li>initializing the <code class="language-plaintext highlighter-rouge">ListStore</code> (<strong>Model</strong>), and</li>
  <li>hooking up the signal.</li>
</ul>

<h4 id="stage-1-cellrenderertext">Stage 1: CellRendererText</h4>

<p>In the introduction to this series, I mentioned that one or more <code class="language-plaintext highlighter-rouge">CellRenderer</code>s are packed into a <code class="language-plaintext highlighter-rouge">TreeViewColumn</code> so it knows how to display its contents. With a <code class="language-plaintext highlighter-rouge">ComboBox</code>, we don’t have a <code class="language-plaintext highlighter-rouge">TreeViewColumn</code>. Instead, as I also said earlier, the <code class="language-plaintext highlighter-rouge">ComboBox</code> is an implementation of the <code class="language-plaintext highlighter-rouge">CellLayout</code> interface. This interface is also implemented by the <code class="language-plaintext highlighter-rouge">TreeViewColumn</code> which means the <code class="language-plaintext highlighter-rouge">ComboBox</code> acts as its own <code class="language-plaintext highlighter-rouge">TreeViewColumn</code> of a sort. From a practical point of view, all this means is that you can treat the <code class="language-plaintext highlighter-rouge">ComboBox</code> as if it has a <code class="language-plaintext highlighter-rouge">TreeViewColumn</code>… sort of. Later on, we’ll dig into this a bit and see how flexible this can be.</p>

<p>For now, though, this is what happens in the first stage of the constructor:</p>

<ul>
  <li>the <code class="language-plaintext highlighter-rouge">CellRenderer</code> is instantiated,</li>
  <li>its packed into the <code class="language-plaintext highlighter-rouge">ComboBox</code>, and</li>
  <li>we use <code class="language-plaintext highlighter-rouge">addAttribute()</code> to tell the <code class="language-plaintext highlighter-rouge">ComboBox</code>:
    <ul>
      <li>what its single column will display,</li>
      <li>which <code class="language-plaintext highlighter-rouge">CellRenderer</code> to use, and</li>
      <li>which column will be visible (in this case, the only column we have).</li>
    </ul>
  </li>
</ul>

<h4 id="stage-2-initializing-the-model">Stage 2: Initializing the Model</h4>

<p>Not a big deal, we just:</p>

<ul>
  <li>assign a local pointer to the <code class="language-plaintext highlighter-rouge">ListStore</code>,</li>
  <li>use <code class="language-plaintext highlighter-rouge">setModel()</code> to tell the <code class="language-plaintext highlighter-rouge">ComboBox</code> where to look for its data, and</li>
  <li>pre-select one of the items, using <code class="language-plaintext highlighter-rouge">setActive()</code>, so the <code class="language-plaintext highlighter-rouge">ComboBox</code> shows a default value.</li>
</ul>

<p>Moving on…</p>

<h4 id="stage-3-the-callback">Stage 3: The Callback</h4>

<p>And the last line of the constructor hooks up the callback signal, but that’s straightforward, so let’s look at the callback code itself:</p>

<div class="language-d highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kt">void</span> <span class="n">doSomething</span><span class="p">(</span><span class="n">ComboBox</span> <span class="n">cb</span><span class="p">)</span>
<span class="p">{</span>
	<span class="nb">string</span> <span class="n">data</span><span class="p">;</span>
	<span class="n">TreeIter</span> <span class="n">treeIter</span><span class="p">;</span>

	<span class="n">write</span><span class="p">(</span><span class="s">"index of selection: "</span><span class="p">,</span> <span class="n">getActive</span><span class="p">(),</span> <span class="s">", "</span><span class="p">);</span>
	
	<span class="k">if</span><span class="p">(</span><span class="n">getActiveIter</span><span class="p">(</span><span class="n">treeIter</span><span class="p">)</span> <span class="p">==</span> <span class="kc">true</span><span class="p">)</span>
	<span class="p">{</span>
		<span class="n">data</span> <span class="p">=</span> <span class="n">getModel</span><span class="p">().</span><span class="n">getValueString</span><span class="p">(</span><span class="n">treeIter</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
		<span class="n">writeln</span><span class="p">(</span><span class="s">"data: "</span><span class="p">,</span> <span class="n">data</span><span class="p">);</span>
	<span class="p">}</span>

<span class="p">}</span> <span class="c1">// doSomething()</span>
</code></pre></div></div>

<p>Again, we define a <code class="language-plaintext highlighter-rouge">TreeIter</code> which we’ll go over in a moment.</p>

<p>The first action we take is to get the index of the currently-selected item. This is here purely for completeness sake. It really has nothing to do with the next step…</p>

<p>which is where we use the <code class="language-plaintext highlighter-rouge">TreeIter</code>, not to stuff data into the <code class="language-plaintext highlighter-rouge">ListStore</code>, but to retrieve it. The <code class="language-plaintext highlighter-rouge">getActiveIter()</code> function returns a <em>Boolean</em> to indicate success or failure, so we can predicate further action on whether or not the <code class="language-plaintext highlighter-rouge">TreeIter</code> gets initialized here. And yes, it’s one of those <em>D</em>-language situations where the function definition looks like this:</p>

<div class="language-d highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">public</span> <span class="kt">bool</span> <span class="n">getActiveIter</span><span class="p">(</span><span class="k">out</span> <span class="n">TreeIter</span> <span class="n">iter</span><span class="p">)</span>
</code></pre></div></div>

<p>And if you don’t yet know, that’s <em>D</em>’s way of asking a function to assign value to an argument. And to make things easy for this worker function, <em>D</em> has the ability to hand it the argument using the <code class="language-plaintext highlighter-rouge">out</code> qualifier.</p>

<p>Anyway, if the <code class="language-plaintext highlighter-rouge">TreeIter</code> gets instantiated by <code class="language-plaintext highlighter-rouge">getActiveIter()</code>, we then:</p>
<ul>
  <li>use <code class="language-plaintext highlighter-rouge">getModel()</code> to grab the <code class="language-plaintext highlighter-rouge">ListStore</code>’s <code class="language-plaintext highlighter-rouge">TreeModel</code> so we can</li>
  <li>use its <code class="language-plaintext highlighter-rouge">getValueString()</code> function to grab the data stored in the first (<code class="language-plaintext highlighter-rouge">0</code>th) column of the <strong>Model</strong>.</li>
</ul>

<p>It looks and sounds far more complex than it actually is. We could have done the same thing like this:</p>

<div class="language-d highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   <span class="n">model</span> <span class="p">=</span> <span class="n">getModel</span><span class="p">();</span>
   <span class="n">data</span> <span class="p">=</span> <span class="n">model</span><span class="p">.</span><span class="n">getValueString</span><span class="p">(</span><span class="n">treeIter</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
</code></pre></div></div>

<p>But, whatever. From there, we can do whatever we want with the fetched data. In this case, we just echo it to the terminal.</p>

<h2 id="conclusion">Conclusion</h2>

<p>Okay, so there we have a reproduction of the <code class="language-plaintext highlighter-rouge">ComboBoxText</code> using a <code class="language-plaintext highlighter-rouge">ComboBox</code> and—who’d-a thunk it—some text. Sure, it’s more work, but as we’ll see in the rest of this mini-series within a series, when we turn to non-string data, we need to know this stuff.</p>

<p>See you next time when we tackle a <code class="language-plaintext highlighter-rouge">ComboBox</code> with integers.</p>

<div class="blog-nav">
	<div style="float: left;">
		<a href="./0050-mvc-iii-comboboxtext-add-remove.html">Previous: MVC - ComboBoxText - Add &amp; Remove</a>
	</div>
	<div style="float: right;">
		<a href="./0052-mvc-v-int-combobox.html">Next: ComboBox with Integers</a>
	</div>
</div>
<p>
	<h3></h3>
<div class="inpage-frame">
	<a href="https://github.com/sponsors/rontarrant">
		<BR>
		<BR>
		<B>Is this article useful? Educational? Entertaining, perhaps?</B>
		<BR>
		<figure class="left">
			<img src="../images/favorite_32.png" alt="Sponsorship heart" style="width: 32px; height: 32px;">
		</figure>
		You're free to accept or decline this invitation to become our newest sponsor.
	</a>
</div>
	<h4 class="comment-blurb"><B>Comments? Questions? Observations?</B></h4>
	<p>
		Did we miss a tidbit of information that would make this post even more informative? Let's talk about it in the comments.
	</p>
	<script src="https://utteranc.es/client.js"
		repo="rontarrant"
		issue-term="pathname"
		theme="github-light"
		crossorigin="anonymous"
		async>
	</script>
	<ul>
		<li> come on over to the <a href="https://forum.dlang.org/">D Language Forum</a> and look for one of the <i>gtkDcoding</i> announcement posts, </li>
		<li> drop by <a href="https://forum.gtkd.org/">the <i>GtkD Forum</i></a>,</li>
		<li> follow the link below to email me, or</li>
		<li> go to the	<a href="https://www.facebook.com">gtkDcoding Facebook page.</a></li>
	</ul>
</p>
<p> You can also subscribe <a href="/feed.xml">via RSS</a> so you won't miss anything. Thank you very much for dropping by.</p>
<p>&copy; Copyright 2025 Ron Tarrant </p>
</div>

	<a class="u-url" href="./0051-mvc-iv-combobox-text.html" hidden></a>
</article>

      </div>
    </main><footer class="site-footer h-card">
  <data class="u-url" href="/"></data>

  <div class="wrapper">

    <h2 class="footer-heading">gtkDcoding</h2>

    <div class="footer-col-wrapper">
      <div class="footer-col footer-col-1">
        <ul class="contact-list">
          <li class="p-name">Ron Tarrant</li><li><a class="u-email" href="mailto:gtkDcoding@gmail.com">gtkDcoding@gmail.com</a></li></ul>
      </div>

      <div class="footer-col footer-col-2"><ul class="social-media-list"><li><a href="https://github.com/rontarrant"><svg class="svg-icon"><use xlink:href="../assets/minima-social-icons.svg#github"></use></svg> <span class="username">rontarrant</span></a></li></ul>
</div>

      <div class="footer-col footer-col-3">
        <p>Simple examples of how to use GtkD to build GUI applications.</p>
      </div>
    </div>

  </div>

</footer>
</body>

</html>
